import { HashRouter, Routes, Route, Navigate } from 'react-router-dom'
// import App from '../App'
import Login from '../component/Login'
import Layout from '../component/Layout'
import User from '../user/user'
import Home from '../user/Home'
import Right from '../user/Rights'
import Goods from '../user/Goods'
import Roles from '../user/Roles'
import Params from '../user/Params'
import Cate from '../user/Cate'
import Reports from '../user/Reports'
import Orders from '../user/Orders'
import { Auth } from '../component/auth'
const Routers = () => {
    return (
        <HashRouter>
            <Routes>
                {/* <Route path='/' element={<App />}></Route> */}
                <Route path='/login' element={<Login />}></Route>
                <Route path='/layout' element={Auth() ? <Layout /> : <Navigate to='/login' />}>
                    <Route path='users' element={<User />}></Route>
                    <Route path='home' element={<Home />}></Route>
                    <Route path='rights' element={<Right />}></Route>
                    <Route path='roles' element={<Roles />}></Route>
                    <Route path='goods' element={<Goods />}></Route>
                    <Route path='params' element={<Params />}></Route>
                    <Route path='categories' element={<Cate />}></Route>
                    <Route path='reports' element={<Reports />}></Route>
                    <Route path='orders' element={<Orders />}></Route>
                </Route>
            </Routes>
        </HashRouter>
    )
}
export default Routers